﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using KillBill.Business.Entities;
using KillBill.Presentation.Common.WindowsForms.View;
using KillBill.Presentation.Modules.Administration.IView;
using KillBill.Presentation.Modules.Administration.Presenter;

namespace KillBill.Presentation.Modules.Administration.View
{
    public partial class CustomerFindView : KillBillWinFormView, ICustomerFind
    {
        public CustomerFindView()
        {
            InitializeComponent();
            presenter = new CustomerFindPresenter(this);
        }

        //public string CustomerID
        //{ 
        //    get
        //    {
        //        return txbCustomerID.Text;
        //    }
        //    set
        //    {
        //        txbCustomerID.Text = value;
        //    }

        //}

        private List<Customer> _customers;
        public List<Customer> Customers
        {
            get { return _customers;}
            set 
            {
                //dgtvCustomer.AutoGenerateColumns = false;

                //var idColumn = new DataGridViewTextBoxColumn();
                //idColumn.DataPropertyName = "CustomerID";
                //idColumn.HeaderText = @"CEDULA";

                //var nameColumn = new DataGridViewTextBoxColumn();
                //nameColumn.DataPropertyName = "Person.FirstName";
                //nameColumn.HeaderText = @"NOMBRE";

                //var lastNameColumn = new DataGridViewTextBoxColumn();
                //lastNameColumn.DataPropertyName = "Person.LastName";
                //lastNameColumn.HeaderText = @"APELLIDO";
                //dgtvCustomer.Columns.Clear();
                //dgtvCustomer.Columns.Add(idColumn);
                //dgtvCustomer.Columns.Add(nameColumn);
                //dgtvCustomer.Columns.Add(lastNameColumn);

                //dgtvCustomer.DataSource = _customers;
            }
        }
        public CustomerFindPresenter presenter{ get; set;}

        private void btnSearch_Click(object sender, EventArgs e)
        {
            presenter.SearchCustomer();
        }



        public string CustomerID
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }
    }
}
